import request from './request';

// 获取轮播图列表
export const getBanners = () => {
    return request({
        url: '/banners',
        method: 'get'
    });
};

// 更新轮播图
export const updateBanners = (data) => {
    return request({
        url: '/banners',
        method: 'put',
        data
    });
};

// 上传轮播图
export const uploadBanner = (data) => {
    return request({
        url: '/banners',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
};

// 删除轮播图
export const deleteBanner = (id) => {
    return request({
        url: `/banners/${id}`,
        method: 'delete'
    });
}; 